package cn.edu.scau.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.scau.dao.NursingPlanMapper;
import cn.edu.scau.entity.NursingPlan;
import cn.edu.scau.entity.NursingPlanShow;
import cn.edu.scau.service.NursingPlanService;

@Service
public class NursingPlanServiceImpl implements NursingPlanService {
	@Autowired
	private NursingPlanMapper nursingPlanMapper;
	
	@Override
	public boolean insert(NursingPlan nursingPlan) {
		//业务逻辑判断
		int line = nursingPlanMapper.insertSelective(nursingPlan);
		return line == 1 ? true:false;
	}

	@Override
	public boolean update(NursingPlan nursingPlan) {
		//业务逻辑判断
		int line = nursingPlanMapper.updateByPrimaryKeySelective(nursingPlan);
		return line == 1 ? true:false;
	}

	@Override
	public boolean delete(Integer customerid,Integer nursingcontentid,Integer nursinglevelid) {
		//业务逻辑判断
		int line = nursingPlanMapper.deleteByPrimaryKey(customerid, nursingcontentid, nursinglevelid);
		return line == 1 ? true:false;
	}

	@Override
	public NursingPlan selectById(Integer customerid,Integer nursingcontentid,Integer nursinglevelid) {
		//业务逻辑判断
		return nursingPlanMapper.selectByPrimaryKey(customerid, nursingcontentid, nursinglevelid);
	}

	@Override
	public List<NursingPlanShow> selectAll() {
		return nursingPlanMapper.selectAll();
	}

}
